package map;

import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;

import java.util.HashMap;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        String line = "Thinking in java! i love you";
        Map<Character,Integer> map = new HashMap<>();
        for (int i=0;i<line.length();i++) {
            char a = line.charAt(i);
            if(map.containsKey(a)){
                int sum = map.get(a);
                sum = sum +1;
                map.put(a,sum);
            }else {
                map.put(a,1);
            }
        }
        System.out.println(map);

    }
}
